<template>
  <div id="system">
    <div class="windows-area">
      <Desktop/>
      <Window :key="window.id" :window="window" v-for="window in windowList"/>
    </div>
    <SystemContext/>
  </div>
</template>

<script>
import Window from "@/layouts/desktop/Window"
import Desktop from "@/layouts/desktop/Desktop"
import SystemContext from "@/layouts/system/SystemContext"

export default {
  name: "System",
  components: {SystemContext, Desktop, Window},
  computed: {
    windowList() {
      return this.$store.state.windowList.filter(item => item.icon)
    }
  },
  mounted() {
    //this.processStatisticalAppSurvivalTime()
  },
  methods: {
    processStatisticalAppSurvivalTime() {
      this.timer = setInterval(() => {
        this.$store.dispatch("statisticalAppData")
      }, 1000)
    }
  }
}
</script>

<style scoped lang="scss">
.context {
  position: fixed;
  right: 0;
  top: 0;
}
</style>
